Hello friends, I installed OpenWrt in my my live book,
I am using http uHTTPd server, to make a server of mine, it is working.
I also installed php for uHTTPd
working now when I try to install msql by running cmd:
opkg install libpthread libncurses libreadline mysql-server, I run into this error:
root@OpenWrt:~# opkg install libpthread libncurses libreadline mysql-server
Package libpthread (1.1.19-1) installed in root is up to date.
Package libncurses (6.1-1) installed in root is up to date.
Package libreadline (7.0-1) installed in root is up to date.
Installing mariadb-server (10.1.41-2) to root...
Downloading http://downloads.openwrt.org/releases/18.06.4/packages/powerpc_464fp/packages/mariadb-server_10.1.41-2_powerpc_464fp.ipk
Configuring mariadb-server.
mysqld: cannot detect privileges table, you might need to
mysqld: run 'mysql_install_db --force' to initialize the system tables
when I do the force happens to me this:
root@OpenWrt:~# mysql_install_db --force
Installing MariaDB/MySQL system tables in '/mnt/data/mysql/' ...
2019-10-20 12:36:10 3081511068 [Note] /usr/bin/mysqld (mysqld 10.1.41-MariaDB) starting as process 4419 ...
2019-10-20 12:36:10 3081511068 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.
2019-10-20 12:36:10 3081511068 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2019-10-20 12:36:10 3081511068 [Note] InnoDB: The InnoDB memory heap is disabled
2019-10-20 12:36:10 3081511068 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-10-20 12:36:10 3081511068 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-10-20 12:36:10 3081511068 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-10-20 12:36:10 3081511068 [Note] InnoDB: Using Linux native AIO
2019-10-20 12:36:10 3081511068 [Note] InnoDB: Using generic crc32 instructions
2019-10-20 12:36:10 3081511068 [ERROR] mysqld: Can't create/write to file '/mnt/data/tmp/ibXXXXXX' (Errcode: 2 "No such file or directory")
2019-10-20 12:36:10 b7ac209c InnoDB: Error: unable to create temporary file; errno: 2
2019-10-20 12:36:10 3081511068 [ERROR] Plugin 'InnoDB' init function returned error.
2019-10-20 12:36:10 3081511068 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-10-20 12:36:10 3081511068 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-10-20 12:36:10 3081511068 [ERROR] Aborting
Installation of system tables failed! Examine the logs in
/mnt/data/mysql/ for more information.
The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:
shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf
You can also try to start the mysqld daemon with:
shell> /usr/bin/mysqld --skip-grant-tables --general-log &
and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/bin/mysql -u root mysql
mysql> show tables;
Can someone help me just missing this to be all OK
root@OpenWrt:~# mkdir -p /mnt/data/tmp
root@OpenWrt:~# mysql_install_db --force
root@OpenWrt:~# /etc/init.d/mysqld start
mysqld: cannot detect privileges table, you might need to
mysqld: run 'mysql_install_db --force' to initialize the system tables
root@OpenWrt:~# mysql_install_db --force --basedir=/usr
root@OpenWrt:~#
root@OpenWrt:~# /etc/init.d/mysqld start
mysqld: cannot detect privileges table, you might need to
mysqld: run 'mysql_install_db --force' to initialize the system tables
Don't want to access the device to view and resolve?
mysqld switches from root to user mariadb when it starts up. So all the folders that it uses (like tmpdir) need to have permissions adjusted for that. For instance the user mariadb needs to have write access to tmpdir etc.
Regarding RAM, yes, that can be an issue. On my 128 MB RAM device I can't run the server without adding a swap file. In another forum topic (here) it was reported that you can run it on a 512 MB RAM device without swap.
@micmac1
Thanks for the reply, and now solved now another problem:
I have php7-mod-mysqli installed but dame error:
bugal error: Error not captured: 'mysqli' class not found in /svr/www/demo/index.php:7 Stack trace: # 0 {main} thrown in /svr/www/demo/index.php on line 7
Running anything on an embedded device that requires swap is not a wise idea. Too many more appropriate SBCs out there at reasonable prices to even do the math around 5-10 MB/s transfer rates and hundreds of MB of swap.